using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Quant.Entities
{
    public class TradeRecord
    {
        [Key]
        public long Id { get; set; }

        [Required]
        public DateTime TradeTime { get; set; } = DateTime.UtcNow;

        [Required]
        [StringLength(10)]
        public string Direction { get; set; } // LONG/SHORT

        [Column(TypeName = "decimal(18,8)")]
        public decimal Quantity { get; set; }

        [Column(TypeName = "decimal(18,8)")]
        public decimal ExecutedPrice { get; set; }

        [Required]
        public int OrderMode { get; set; } // 关联策略配置

        [Range(1, 125)]
        public int Leverage { get; set; }

        [StringLength(50)]
        public string Symbol { get; set; }

        [Column(TypeName = "decimal(18,8)")]
        public decimal PositionValue { get; set; }

        [StringLength(20)]
        public string Status { get; set; } = "PENDING"; // 订单状态
    }
}